/*
 * Created on 15.10.2006 by leck
 *
 */
package de.devisnik.eidle;

import junit.framework.TestCase;
import de.devisnik.eidle.util.Parameters;

public class ParametersTest extends TestCase {

    public void testInit() {
        Parameters parameters = new Parameters(new String[] {"/a -b hallo"});
        assertNotNull(parameters);
    }
    
    public void testIsConfigurationMode() {
        Parameters configParameters = new Parameters(new String[] {"/c"});
        assertTrue(configParameters.isConfigurationMode());

        Parameters nonConfigParameters = new Parameters(new String[] {"/s"});
        assertFalse(nonConfigParameters.isConfigurationMode());       

        Parameters emptyParameters = new Parameters(new String[] {});
        assertFalse(emptyParameters.isConfigurationMode());       
    }
    
    public void testIsPreviewMode() {
        Parameters previewParameters = new Parameters(new String[] {"/p", "1234"});
        assertTrue(previewParameters.isPreviewMode());
        assertEquals(new Integer(1234), previewParameters.getScreenHandle());
        
        Parameters nonConfigParameters = new Parameters(new String[] {"/s"});
        assertFalse(nonConfigParameters.isPreviewMode());       
    }
     
    
    public void testIsSaverMode() {
        Parameters debugParameters = new Parameters(new String[] {"/s"});
        assertTrue(debugParameters.isSaverMode());
        
        Parameters nonConfigParameters = new Parameters(new String[] {"/p"});
        assertFalse(nonConfigParameters.isSaverMode());       
    }
    
    public void testToString() {
        Parameters parameters = new Parameters(new String[] {"/p", "numberTwo"});
        assertEquals("/p numberTwo", parameters.toString());
        
    }
}
